<template>
  <a-modal v-model="visible" :footer="null" title="本地文件存储" width="40%">
    <a-spin :spinning="confirmSpin">
      <a-form-model
        ref="form"
        :model="configData"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol">

        <a-form-model-item label="文件上传根目录" prop="localUpload">
          <a-input v-model="configData.localUpload" placeholder="D:\\opt\\upFiles" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="webapp文件路径" prop="localWebapp">
          <a-input v-model="configData.localWebapp" placeholder="D:\\opt\\webapp" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>


        <a-form-model-item :wrapper-col="{ span: 14, offset: 7 }" v-if="!disable">
          <a-button type="primary" style="width:100px;" @click="onSubmit">
            修改
          </a-button>
          <a-button style="margin-left: 20px;width:100px;" @click="resetForm">
            重置
          </a-button>
        </a-form-model-item>

      </a-form-model>
    </a-spin>
  </a-modal>
</template>
<script>

import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";

export default {
  name: "LocalUploadModal",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  data() {
    return {
      description: "本地文件上传配置",
      rules: {
        localUpload: [
          {required: true, message: '请输入文件上传根目录', trigger: 'blur'},
          {min: 3, message: '请输入3个字符以上 示例：/opt/fileUpload', trigger: 'blur'},
        ],
        localWebapp: [
          {required: true, message: '请输入webapp文件路径', trigger: 'blur'},
          {min: 3, message: '请输入3个字符以上 示例：/opt/webapp', trigger: 'blur'},
        ],
      },
      type: "localConfig",
      configData: {
        localUpload: "",
        localWebapp: "",
      },
      url: {
        configUpdate: "/config/storage/local",
      }
    }
  },
}
</script>

<style scoped>

</style>